using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class PhieuXuatKhoManagement
	{
	
		public ResultObj SaveNewPhieuXuatKho(PhieuXuatKho phieuxuatkho)
        		{
			ResultObj result = new ResultObj();
			phieuxuatkho.Id = -1;
			PhieuXuatKhoDAO phieuxuatkhoDAO = new PhieuXuatKhoDAO();
			result = phieuxuatkhoDAO.SavePhieuXuatKho(phieuxuatkho);
			
			return result;
		}
		
		public ResultObj UpdatePhieuXuatKho(PhieuXuatKho phieuxuatkho)
        		{
			ResultObj result = new ResultObj();
			PhieuXuatKhoDAO phieuxuatkhoDAO = new PhieuXuatKhoDAO();
			result = phieuxuatkhoDAO.SavePhieuXuatKho(phieuxuatkho);
			
			return result;
		}
		
		public ResultObj DeletePhieuXuatKho(PhieuXuatKho phieuxuatkho)
        		{
			ResultObj result = new ResultObj();
			PhieuXuatKhoDAO phieuxuatkhoDAO = new PhieuXuatKhoDAO();
			result = phieuxuatkhoDAO.DeletePhieuXuatKho(phieuxuatkho);
			
			return result;
		}
		
		public ResultObj GetAllPhieuXuatKho( )
        		{
			ResultObj result = new ResultObj();
			PhieuXuatKhoDAO phieuxuatkhoDAO = new PhieuXuatKhoDAO();
			result = phieuxuatkhoDAO.GetAllPhieuXuatKho();
			
			return result;
		}
		
		public ResultObj GetPhieuXuatKhoById(PhieuXuatKho phieuxuatkho)
        		{
			ResultObj result = new ResultObj();
			PhieuXuatKhoDAO phieuxuatkhoDAO = new PhieuXuatKhoDAO();
			result = phieuxuatkhoDAO.GetAllPhieuXuatKhoByID(phieuxuatkho);
			
			return result;
		}

        public ResultObj GetPhieuXuatKhoByMaSo(PhieuXuatKho phieuxuatkho)
        {
            ResultObj result = new ResultObj();
            PhieuXuatKhoDAO phieuxuatkhoDAO = new PhieuXuatKhoDAO();
            result = phieuxuatkhoDAO.GetAllPhieuXuatKhoByMaSo(phieuxuatkho);

            return result;
        }
					
	}
}
